package com.baseweb.webadmin.core.model.bvo;

import com.baseweb.webadmin.core.constants.AuthType;
import org.apache.commons.lang.StringUtils;

public class UserVerifyBvo {
    private Integer userId;
    private String verifyStr;
    private String verifyNameStr;
    private String statusStr;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getVerifyStr() {
        return verifyStr;
    }

    public void setVerifyStr(String verifyStr) {
        this.verifyStr = verifyStr;
    }

    public String getStatusStr() {
        return statusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public String getVerifyNameStr() {
        if (StringUtils.isNotBlank(verifyStr)){
            if (verifyStr.indexOf(",") != -1){
                String tmpArr[] = verifyStr.split(",");
                StringBuffer sb = new StringBuffer();
                for (int i = 0; i < tmpArr.length; i++) {
                    if (i == 0){
                        sb.append(AuthType.getNameByCode(Integer.valueOf(tmpArr[i]).intValue()).getName());
                    }else{
                        sb.append(","+AuthType.getNameByCode(Integer.valueOf(tmpArr[i]).intValue()).getName());
                    }
                }
                return sb.toString();
            }else{
                return AuthType.getNameByCode(Integer.valueOf(verifyStr).intValue()).getName();
            }
        }
        return null;
    }

    public void setVerifyNameStr(String verifyNameStr) {
        this.verifyNameStr = verifyNameStr;
    }
}
